<?php
/**
 * Created by Administrator.
 * Author: Administrator
 * Date: 2018/1/29
 */

namespace app\Controllers;


use Server\CoreBase\Controller;

class ReportController extends Controller
{
    public function http_report_warn()
    {
        if(strtolower($this->http_input->server('request_method')) !== 'post') {
            $this->http_output->end('MethodNotAllowException');
        }

        if(!$code = $this->http_input->post('code') && !$message = $this->http_input->post('message') && !$client = $this->http_input->post('client')) {
            $this->http_output->end('Be Lacking Of Params!');
        }

        $this->http_output->end($this->http_input->getAllPostGet());
        echo 'hah';

/*//        yield $this->redis_pool->getCoroutine()->publish('testReport', json_encode($this->http_input->getAllPostGet()));*/
    }

    public function http_mysqlTest() {
        $value = $this->mysql_pool->dbQueryBuilder->insertInto('MysqlTest')->intoColumns(['uid', 'statics'])->intoValues([[36, 0], [37, 0]])->getStatement(true);
        $this->http_output->end($value);
    }
}